trichview.com

trichview.support




Re: Hyperlink [solved]


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/18/2004 21:34:52


It's better to use this code:



if not RichViewEdit1.GetItemAt(X, Y, rvdata, lItemNo, lOffset, True) then

  exit;

rvstyle := rvdata.GetRVStyle;

rvii := rvdata.GetItem(lItemNo);

if rvii.GetBoolValueEx(rvbpJump, RVStyle) then

begin

  URL := PChar(RVData.GetItemTag(lItemNo));

  if ShellExecute(0, 'open', PChar(URL), nil, nil, SW_SHOW)<=32 then


Application.MessageBox(PChar(Format(RVA_GetS(rvam_hl_CannotNavigate),[URL]))

,

      RVA_GetPC(rvam_err_Title), MB_OK or MB_ICONEXCLAMATION);

end;


>

> I ended up with this, which seems to work:

>

>  if lItemNo <> -1 then

>

>   begin

>

> RichViewEdit1.GetItemAt(X, Y, rvdata, lItemNo, lOffset, True);

>

>     rvstyle := rvdata.GetRVStyle;

>

>     rvii := RichViewEdit1.GetCurrentItem;

>

>     if rvii.GetBoolValueEx(rvbpJump, RVStyle) then

>

>     begin

>

>       lID := rvii.JumpID;

>

>       URL := PChar(RVData.GetItemTag(lItemNo));

>

>       if ShellExecute(0, 'open', PChar(URL), nil, nil, SW_SHOW)<=32 then

>

>

>

Application.MessageBox(PChar(Format(RVA_GetS(rvam_hl_CannotNavigate),[URL]))

,

>

>

>           RVA_GetPC(rvam_err_Title), MB_OK or MB_ICONEXCLAMATION);

>

>

>

>

>

>     end;

>

>   end;

>

> "Steve Beebe" <[email protected]> wrote:

> >

> >OK, after an hour or so, I can't figure out how to determine if the

current

> >item is a hyperlink, then get the id, so I can execute the hyperlink.  Is

> >there an example?

> >

> >Seems that the OnRVMouseOver event passes the ID, but he the onRVMouseUP

> >does not.

> >

> >thanks,

> >

> >steve

> >

> >

> >"Sergey Tkachenko" <[email protected]> wrote:

> >>Sorry, I missed this question.

> >>

> >>You can do it by processing OnRVMouseUp. In this event use GetItemAt to

> >find

> >>the clicked item. If this is a hyperlink, execute it.

> >>If you include the attached unit to the project, text hyperlinks will

always

> >>show hypertext cursor.

> >>

> >>

> >>> hi,

> >>> May I know where to set the property to let single click for hyperlink

> >>> without pressing ctrl button?

> >>>

> >>> best regards,

> >>> Chen Yap

> >>>

> >>>

> >>

> >>

> >>

> >

>





Powered by ABC Amber Outlook Express Converter